package es.ihatetothink.restaurantesCeliacos;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

class AdaptadorTitulares extends ArrayAdapter {
	 
    
	Activity context;
	private Titular[] datos;
	
 
       public AdaptadorTitulares(Activity context, Titular[] datos) {
            super(context, R.layout.simple_list_item_1, datos);
            this.context = context;
            this.datos = datos;
        }
 
        public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = context.getLayoutInflater();
        View item = inflater.inflate(R.layout.simple_list_item_1, null);
        
        TextView lblTitulo = (TextView)item.findViewById(R.id.LblTitulo);
        lblTitulo.setText(datos[position].getTitulo());
 
        TextView lblSubtitulo = (TextView)item.findViewById(R.id.LblSubTitulo);
        lblSubtitulo.setText(datos[position].getSubtitulo());
 
        return(item);
    }
}